using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Attack : MonoBehaviour
{
    private void OnTriggerEnter2D(Collider2D other)
    {
        if(other == null)
            return;
        if (other.CompareTag("Enemy"))
        {
            IAttack attack = other.gameObject.GetComponent<IAttack>();
            attack.Attack();
        }
    }
}
